gtk-demo: Stop using child properties
authorMatthias Clasen <mclasen@redhat.com>
Fri, 5 Apr 2019 03:59:06 +0000 (03:59 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 5 Apr 2019 12:01:43 +0000 (12:01 +0000)
demos/gtk-demo/panes.c
demos/gtk-demo/sliding_puzzle.c

index 675bc5d9eaca55dd2b723d50150e34ddf15224ea..e023cd22ba8dc2036badd6a897cd07b6ffff1396 100644 (file)
@@ -27,10 +27,16 @@ toggle_resize (GtkWidget *widget,
 
   is_child1 = (child == gtk_paned_get_child1 (paned));
 
-  gtk_container_child_get (GTK_CONTAINER (paned), child,
-                           "resize", &resize,
-                           "shrink", &shrink,
-                           NULL);
+  if (is_child1)
+    g_object_get (paned,
+                  "resize-child1", &resize,
+                  "shrink-child1", &shrink,
+                  NULL);
+  else
+    g_object_get (paned,
+                  "resize-child2", &resize,
+                  "shrink-child2", &shrink,
+                  NULL);
 
   g_object_ref (child);
   gtk_container_remove (GTK_CONTAINER (parent), child);
@@ -55,10 +61,16 @@ toggle_shrink (GtkWidget *widget,
 
   is_child1 = (child == gtk_paned_get_child1 (paned));
 
-  gtk_container_child_get (GTK_CONTAINER (paned), child,
-                           "resize", &resize,
-                           "shrink", &shrink,
-                           NULL);
+  if (is_child1)
+    g_object_get (paned,
+                  "resize-child1", &resize,
+                  "shrink-child1", &shrink,
+                  NULL);
+  else
+    g_object_get (paned,
+                  "resize-child2", &resize,
+                  "shrink-child2", &shrink,
+                  NULL);
 
   g_object_ref (child);
   gtk_container_remove (GTK_CONTAINER (parent), child);
index 60762342c96678b7f199805a2d290737206b355b..dd1bc65151a0cc5993cafdbb519b7aa2cd77c23b 100644 (file)
@@ -236,10 +236,7 @@ puzzle_button_pressed (GtkGestureMultiPress *gesture,
       return;
     }
 
-  gtk_container_child_get (GTK_CONTAINER (grid), child,
-                           "left-attach", &l,
-                           "top-attach", &t,
-                           NULL);
+  gtk_grid_query_child (GTK_GRID (grid), child, &l, &t, NULL, NULL);
 
   if (l == pos_x && t == pos_y)
     {